package org.fly.controller;


import org.fly.service.SmsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by rongzhao.zhu on 2018/4/13.
 */
@Controller
@RequestMapping("/sms/")
public class SmsController extends AbstractController{
    @Autowired
    SmsRecordService smsRecordService;
    @RequestMapping(value = "sendVerify", produces = "application/json;charset=utf-8")
    @ResponseBody
    public String save(String telephone) {

        try {
            smsRecordService.sendVerify(telephone);
            return toJSONString(SUCCESS);
        } catch (Exception e) {
            return toExceptionString(e);
        }
    }
}
